home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / A-Monthly Disks / (c)abl.d64 / QUIZ (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  8KB  |  196 lines

  1. 5 POKE691,1:GOTO320
  2. 10 SYS52440:IFA1%>.THENA$=LEFT$(SP$,A1%):SYS52360
  3. 15 RETURN
  4. 20 CLOSE4:CLOSE15:RETURN
  5. 25 A1%=-1:SYS52420:NL=NL+1:RETURN
  6. 30 CLOSE4:GOTO370
  7. 35 IQ=.:GOTO370
  8. 40 Q=.:OPEN4,8,4,"0:"+F$:OPEN15,8,15:INPUT#15,Q:IFQTHENPRINT#15,"I"
  9. 45 CLOSE4:CLOSE15:RETURN
  10. 50 A$="[194]UFFER FULL, EDIT AND SAVE!":GOSUB125:RETURN
  11. 55 SYS52300:IFA1%<0THEN95
  12. 60 A$=LEFT$(SP$,A1%):SYS52360:GOSUB725:O$=A$:RETURN
  13. 65 A$="[212]OPICS [193]VAILABLE:":GOSUB125:IFQA=.THENA$="[206]O [212]OPICS":GOSUB125:GOTO370
  14. 66 A$="### [209]UIZ [206]AME       [193]UTHOR          #[209]":GOSUB125
  15. 67 A$="--- --------------- --------------- --":GOSUB125
  16. 70 FORQ=0TOQA-1:A$=""+MID$(STR$(Q),2)+" - "+QT$(Q):GOSUB125:NEXT:A$="":GOSUB125:GOTO370
  17. 75 ON-(QT=QM)GOTO290:OPEN4,8,4,"0:/SUM"+STR$(QT)+",S,R":QM=QT
  18. 80 FORQ=1TO7:INPUT#4,QH$(Q),A$:QH(Q)=VAL(A$):NEXT:CLOSE4:RETURN
  19. 85 Q=.:FORL=1TO7:IFQH$(L)=N$THENQ=1
  20. 90 NEXT:RETURN
  21. 95 PRINT"[212][197]":GOTO795
  22. 100 IFRIGHT$(A$,1)=""THENA$=LEFT$(A$,LEN(A$)-1)
  23. 105 RETURN
  24. 110 SYS52340:RETURN
  25. 115 CLOSE15:OPEN15,8,15,"S0:/SUM"+STR$(QT):CLOSE15:OPEN4,8,4,"0:/SUM"+STR$(QT)+",S,W"
  26. 120 FORQ=1TO7:PRINT#4,QH$(Q)R$STR$(QH(Q))R$;:NEXT:CLOSE4:RETURN
  27. 125 PRINT"[152]";:GOSUB210:SYS52310:RETURN
  28. 130 FORK=0TONL-1:A1%=K:GOSUB10:PRINT#4,A$;:IFRIGHT$(A$,1)<>R$THENPRINT#4," ";
  29. 135 NEXTK:CLOSE4:ONQQGOTO195:GOTO30
  30. 140 IFQT=QATHENQA=QA+1:QT$(QA)=A$:GOTO150
  31. 145 QT$(QT)=A$
  32. 150 IFQA>1THENOPEN15,8,15,"S0:/QCAT":CLOSE15
  33. 155 OPEN4,8,4,"0:/QCAT,S,W":PRINT#4,MID$(STR$(QA),2)R$;:FORQ=0TOQA:PRINT#4,QT$(Q)R$;:NEXT:CLOSE4
  34. 160 RETURN
  35. 165 WA=.:FORQ=1TOAN:IFA$=AN$(Q)THENWA=1
  36. 170 NEXT:RETURN
  37. 175 WA=.:FORQ=1TOAN:FORL=1TOLEN(A$):IFMID$(A$,L,LEN(AN$(Q)))=AN$(Q)THENWA=1
  38. 180 NEXTL,Q:RETURN
  39. 185 WA=.:FORQ=1TOAN:IFVAL(A$)=VAL(AN$(Q))THENWA=1
  40. 190 NEXT:RETURN
  41. 195 QQ=.:OPEN4,8,4,"0:/TOPIC"+STR$(QT)+",S,A":NL=.:SYS52410:POKE680,CW:POKE682,1
  42. 200 IFCTTHENA$="[195]ONTINUING...":GOSUB125:CT=.:A$=LL$:GOSUB125:GOTO865
  43. 205 NEXTT:GOTO370
  44. 210 IFLL=1OR(PEEK(56577)AND16)=THTHENRETURN
  45. 215 GOTO800
  46. 220 POKE659,6+ABS((BD=1200)*2):C=1022730/BD:GOSUB285:POKE51968,A2%:POKE51969,A1%
  47. 225 IFBD=1200THENC=1022730/BD*.966:GOSUB285
  48. 230 POKE665,A2%:POKE666,A1%:C=1022730/BD/2-100:GOSUB285:POKE661,A2%:POKE662,A1%
  49. 235 RETURN
  50. 240 B$="[164]"
  51. 245 SYS52450:B$=LEFT$(A$,ABS(A1%-1)):RETURN
  52. 250 A$="":SYS52320:IFA2%=0THENRETURN
  53. 255 IFA2%=1ORA2%=3ORA2%=16ORA2%=9THENA$="[193]":RETURN
  54. 260 IFA2%<>83ANDA2%<>19THENRETURN
  55. 265 FORKK=1TO2E3:SYS52320:IFA2%=0THEN280
  56. 270 IFA2%=17ORA2%=67THENKK=2E3
  57. 275 IFA2%=65ORA2%=13THENA$="[193]":KK=2E3
  58. 280 NEXTKK:RETURN
  59. 285 A1%=C/256:A2%=C-A1%*256:RETURN
  60. 290 RETURN
  61. 295 GOSUB125:IFIT$=""THENGOSUB55:IT$=A$:GOSUB310:RETURN
  62. 300 GOSUB310:IFPEEK(679)<>1THENGOSUB125:O$=A$:A$="":GOSUB125:A$=O$
  63. 305 RETURN
  64. 310 A$=IT$:B$=":":GOSUB245:IFA1%=0THENIT$="":RETURN
  65. 315 IT$=MID$(A$,A1+1):A$=B$:RETURN
  66. 320 OPEN5,2,0:A1%=1:A2%=1:FORK=1TO127:SP$=SP$+" ":NEXTK:R$=CHR$(13)
  67. 325 A1%=0:GOSUB10:RK$=A$:ZE$=CHR$(0)
  68. 330 A1%=1:GOSUB10:BD=VAL(LEFT$(A$,5)):LL=VAL(MID$(A$,6)):A1%=2:GOSUB10:TH=VAL(A$)
  69. 335 A1%=4:GOSUB10:IT$=A$:GOSUB220:GOSUB715
  70. 340 QM=10:ON-(QA<>.)GOTO355:GOSUB75:OPEN4,8,4,"/QCAT,S,R":INPUT#4,A$:QA=VAL(A$):IFQA=.GOTO30
  71. 345 FORQ=0TOQA-1:IFST<>0THENCLOSE4:GOTO370
  72. 350 INPUT#4,QT$(Q):NEXT:CLOSE4:A$="":GOSUB125
  73. 355 A$="** [212]HE [209]UIZ [204]INK **":A$=LEFT$(SP$,(CW-LEN(A$))/2)+A$+"":GOSUB125
  74. 360 A$="[194]Y [196]AN [195]OLE (C)1988":A$=LEFT$(SP$,(CW-LEN(A$))/2)+A$+"":GOSUB125
  75. 363 A$="[214]ERSION 1.2":A$=LEFT$(SP$,(CW-LEN(A$))/2)+A$+"":GOSUB125
  76. 365 F$="[209][201][206][212][210][207]":GOSUB765:GOSUB250:B$="":A$="":O$="":IT$=""
  77. 370 GOSUB820:A$="[209]UIZ ("+MID$(STR$(QT),2)+") > ":GOSUB295:GOSUB110:IFA$=""THEN370
  78. 375 IFA$="[199]"ORLEFT$(A$,2)="[199][207]"ORA$="[216]"ORA$="[194][217][197]"THENIT$=A$:GOTO795
  79. 380 ON-(A$="[200]"ORA$="?"ORA$="[200][197][204][208]")GOTO415:IFA$="[194][194][211]"THEN795
  80. 385 IFLEFT$(A$,5)="[210][197][211][197][212]"ANDSC>7THENL=6:GOSUB695:ONIQGOTO35:GOTO635
  81. 390 IFLEFT$(A$,4)="[208][207][211][212]"ANDSC>7THENL=5:GOSUB695:ONABS(IQORQT>QA)GOTO35:GOTO430
  82. 395 ON-(A$="[204][201][211][212]")GOTO65:IFLEFT$(A$,4)="[209][213][201][218]"THENL=5:GOSUB695:ONIQGOTO35:GOTO540
  83. 400 IFLEFT$(A$,4)="[200][201][199][200]"THENL=5:GOSUB695:ONIQGOTO35:GOSUB670:GOTO370
  84. 405 IFLEN(A$)=1ANDASC(A$)>47ANDASC(A$)<58THENA$="[209][213][201][218]"+A$:GOTO395
  85. 410 GOTO370
  86. 415 F$="[209][200][197][204][208]":GOSUB765:GOSUB250:IFFF%=0THEN370
  87. 420 CLOSE1:OPEN1,8,15,"I":CLOSE1
  88. 425 GOTO370
  89. 430 F$="/TOPIC"+STR$(QT):GOSUB40:IFQTHEN445
  90. 435 A$="[212]OPIC"+STR$(QT)+" [197]XISTS, [210]EPLACE ? ":GOSUB295:IFA$<>"Y"THEN370
  91. 440 OPEN15,8,15,"S0:"+F$:CLOSE15
  92. 445 A$="[212]OPIC > ":GOSUB295:ON-(A$="")GOTO370:GOSUB140
  93. 450 A$="# OF [209]UESTIONS ? ":GOSUB295:IFA$=""GOTO370
  94. 455 Q=VAL(A$):IFQ<.ORQ>25GOTO450
  95. 460 OPEN4,8,4,"0:"+F$+",S,W":PRINT#4,MID$(STR$(Q),2)R$;:NL=.
  96. 465 A$="[200]IT [210][197][212][213][210][206][160]ON A BLANK LINE WHEN DONE.":GOSUB125
  97. 470 PL=55:SYS52410:POKE680,CW:POKE682,1
  98. 475 FORT=1TOQ:A$="[209]UESTION"+STR$(T)+"...":GOSUB125:GOSUB865:LL$=A$
  99. 480 A$="[193]NSWER [212]YPES:":GOSUB125
  100. 485 A$="[193] - [197]XACT[194] - [211]EARCH [211]TRING[195] - [206]UMERIC[196] - [195]ONTINUE[197] - [197]XIT":GOSUB125
  101. 490 A$="[212]YPE ? ":GOSUB295:GOSUB110:IFASC(A$+ZE$)<193ORASC(A$+ZE$)>197GOTO490
  102. 495 IFASC(A$)=196THENA$="[195]ONTINUING...":GOSUB125:A$=LL$+"":GOSUB125:GOSUB870:GOTO480
  103. 500 IFASC(A$)=197THENCLOSE4:OPEN15,8,15,"S0:"+F$:CLOSE15:GOTO370
  104. 505 A$="\"+R$+A$+R$:GOSUB25:L=1:A$="[197]NTER EACH ANSWER ON A LINE BY ITSELF":GOSUB125
  105. 510 A$="AND HIT [210][197][212][213][210][206][160]ON A BLANK LINE WHEN DONE.":GOSUB125
  106. 515 ON-(L=11)GOTO525:A$=MID$(STR$(L),2)+". ":GOSUB295:IFA$=""THEN525
  107. 520 Q$(L)=A$+R$:L=L+1:GOTO515
  108. 525 L=L-1:A$=MID$(STR$(L),2)+R$:GOSUB25:FORK=1TOL:A$=Q$(K):GOSUB25:NEXTK
  109. 530 IFNL>40THENQQ=1:GOSUB50:GOTO895
  110. 535 A$=" "+R$:NEXTT:A$="[212]OPIC COMPLETE, EDIT AND SAVE!":GOSUB125:GOTO895
  111. 540 GOSUB85:IFQTHENA$="[217]OU'RE IN THE HIGH SCORE!":GOSUB125:GOTO370
  112. 545 F$="/TOPIC"+STR$(QT):GOSUB40:IFQTHENA$="[212]OPIC [213]NAVAILABLE":GOSUB125:GOTO370
  113. 550 A$="[[209]]: "+QT$(QT):GOSUB125:OPEN4,8,4,"0:/TOPIC"+STR$(QT)+",S,R":INPUT#4,A$
  114. 555 QS=VAL(A$):A$="# OF [209]UESTIONS ="+STR$(QS)+"":GOSUB125:RA=.
  115. 560 FORT=1TOQS:A$="[209]UESTION :"+STR$(T)+"":GOSUB125
  116. 565 GET#4,C$:IFST<>0THENCLOSE4:OPEN4,8,4,"$":GOTO585
  117. 570 A$=LEFT$(SP$,CW):SYS52380:A$=C$+LEFT$(A$,A1%):C$="":IFA2%<1THENC$=""
  118. 575 IFMID$(A$,2,1)="\"THEN590
  119. 580 A3%=A2%:GOSUB125:GOSUB250:IFA$<>"[193]"ANDA3%<1THEN570
  120. 585 POKE684,0:AB%=-(A$="[193]"):GOTO30
  121. 590 INPUT#4,A$:GOSUB100:TT$=A$:INPUT#4,A$:AN=VAL(A$):FORQ=1TOAN:INPUT#4,A$:GOSUB100:GOSUB110
  122. 595 AN$(Q)=A$:NEXT
  123. 600 A$="> ":GOSUB295:GOSUB110:ON-(TT$="[193]")GOSUB165:ON-(TT$="[194]")GOSUB175:IFTT$="[195]"THENGOSUB185
  124. 605 A$="[201]NCORRECT":IFWATHENA$="[195]ORRECT":RA=RA+1
  125. 610 A$=A$+" [193]NSWER !":GOSUB125:NEXTT:QH=RA:CLOSE4:GOSUB660:IFL=.THEN630
  126. 615 IFQH<QH(7)THENA$="[217]OU SCORED"+STR$(QH)+" OUT OF"+STR$(QS)+" !":GOSUB125:GOTO630
  127. 620 A$="[217]OU [193]RE #"+MID$(STR$(Q),2)+" [207]N [212]HE [200]IGH [211]CORE [204]IST !":GOSUB125
  128. 625 A$="[211]TANDBY, [213]PDATING [211]CORES !":GOSUB125:GOSUB115:GOSUB670:GOTO370
  129. 630 A$="[214]IEW [200]IGH [211]CORES ? ":GOSUB295:GOSUB110:ON-(A$<>"[217]")GOTO370:GOSUB670:GOTO370
  130. 635 A$="[195]REATING [200]IGH [211]CORE [198]ILE !":GOSUB125:CLOSE15:OPEN15,8,15,"S0:/SUM"+STR$(QT)
  131. 640 CLOSE15:OPEN4,8,4,"0:/SUM"+STR$(QT)+",S,W":FORQ=1TO7
  132. 645 PRINT#4,"[200]IGH [211]CORE [210]ESET"R$"0"R$;:NEXT:QM=10:CLOSE4:GOSUB75:GOTO370
  133. 650 B$=MID$(STR$(K),2,3)+":":IFLEN(B$)<4THENB$=" "+B$
  134. 655 RETURN
  135. 660 L=.:FORQ=1TO7:ON-(QH>QH(Q))GOTO665:NEXT:RETURN
  136. 665 L=1:FORK=7TOQSTEP-1:QH$(K+1)=QH$(K):QH(K+1)=QH(K):NEXT:QH$(Q)=N$:QH(Q)=QH:RETURN
  137. 670 A$="[200]ALL OF [198]AME: [209]UIZ"+STR$(QT)+"":GOSUB125
  138. 675 A$="#  [200]IGH [211]CORER                  [211]CORE":GOSUB125
  139. 680 A$="-------------------------------------":GOSUB125
  140. 685 FORQ=1TO7:Q$=MID$(STR$(Q),2)
  141. 690 A$=Q$+". "+QH$(Q)+LEFT$(SP$,31-LEN(QH$(Q)))+STR$(QH(Q))+R$:GOSUB125:A$="":NEXT:RETURN
  142. 695 QT=VAL(MID$(A$,L)):IFL-1=LEN(A$)THENIQ=1:RETURN
  143. 700 IFLEFT$(A$,4)<>"[208][207][211][212]"THENIFQT<.ORQT>QA-1THENA$="[201]NVALID [209]UIZ#":GOSUB125:IQ=1:RETURN
  144. 705 IFLEFT$(A$,5)="[210][197][211][197][212]"THENRETURN
  145. 710 GOSUB75:RETURN
  146. 715 A$=LEFT$(RK$,30):GOSUB240:N$=B$:SC=ASC(MID$(RK$,37,1)):CW=ASC(MID$(RK$,41,1))
  147. 720 RETURN
  148. 725 IFA2%<1THENRETURN
  149. 730 B$=A$:IFA2%<>67THEN745
  150. 735 A$="[195]HAT MODE.":GOSUB125:A1=PEEK(680):A2=PEEK(682):POKE680,37:POKE682,1
  151. 740 FORK=0TO1:GOSUB55:K=-(A$="/"):NEXTK:POKE680,A1:POKE682,A2:GOTO760
  152. 745 IFA2%<>84THEN755
  153. 750 TI$="000010":GOTO760
  154. 755 IFA2%=75THEN795
  155. 760 GOSUB55:A$=B$+A$:RETURN
  156. 765 GOSUB250:IFA$="[193]"THENRETURN
  157. 770 A$="":GOSUB125:POKE684,0:OPEN4,8,4,"0:"+F$+",S,R":GET#4,C$
  158. 775 FF%=0:IFST<>0THENFF%=1:CLOSE4:OPEN4,8,4,"$":GOTO790
  159. 780 A$=LEFT$(SP$,CW):SYS52380:A$=C$+LEFT$(A$,A1%):C$="":IFA2%<1THENC$=""
  160. 785 A3%=A2%:GOSUB125:GOSUB250:IFA$<>"[193]"ANDA3%<1THEN780
  161. 790 POKE684,0:AB%=-(A$="[193]"):A$="":GOSUB125:CLOSE4:RETURN
  162. 795 A$="([210]ETURNING TO [194][194][211])":GOSUB125:A$=""
  163. 800 PRINT:PRINT"[145][145][145][145]SYS52470:REM[145][145][145]"
  164. 805 SYS52410:A$=RK$:A1%=-1:SYS52420:A$=STR$(BD)+"     "+STR$(LL):A1%=-1:SYS52420
  165. 810 A$=STR$(TH):A1%=-1:SYS52420:A$=IT$:A1%=-1:SYS52420:A$=""
  166. 815 POKE631,13:POKE198,1:CLOSE5:END
  167. 820 A=VAL(TI$)/100:B=SC*10--10:A=B-A:IFA<0THENA$="[217]":RETURN
  168. 825 A=VAL(MID$(STR$(A),2,3)):IFA>3THENRETURN
  169. 830 LP=LP--1:IFLP>3THENA$="[217]OU HAVE"+STR$(A)+" MINUTES LEFT.":GOSUB125:LP=0
  170. 835 RETURN
  171. 840 A$="0":IFLEN(E1$)>1THENA$=MID$(E1$,2)
  172. 845 C=VAL(A$):IFC>0ANDC<NLTHENRETURN
  173. 850 IFA$="0"THENC=0:RETURN
  174. 855 B$=A$:FORC=0TONL:A1%=C:GOSUB10:SYS52450:IFA1%>.THENRETURN
  175. 860 NEXTC:A$="[207]UT OF [210]ANGE!":GOSUB125:RETURN
  176. 865 BF=.:E1$=""
  177. 870 FORK=NLTOPL:BF=BF+1:IFBF>39THENLL$=A$:QQ=1:NL=K:CT=1:GOSUB50:GOTO895
  178. 875 GOSUB55
  179. 880 IFA$=""THENNL=K:RETURN
  180. 885 IFA2%>-1THENA$=A$+R$
  181. 890 A1%=-1:SYS52420:NEXTK:NL=K:RETURN
  182. 895 B$="":A5%=PEEK(680):A6%=PEEK(682):POKE680,40:POKE682,0
  183. 900 A$="> ":GOSUB125:GOSUB55:POKE680,A5%:POKE682,A6%:E1$=A$:IFNL<.THENNL=.
  184. 905 B$=A$:A$=LEFT$(B$,1):SYS52340:A1$=A$:A$=B$:B$=A1$
  185. 910 ON-(B$="[211]")GOTO130:IFB$="[204]"GOTO925
  186. 915 IFB$="[197]"GOTO945
  187. 920 GOTO895
  188. 925 C=.:GOSUB840
  189. 930 FORK=CTONL:GOSUB650:A1%=K:GOSUB10:IFRIGHT$(A$,1)<>R$THENA$=A$+""
  190. 935 A$=B$+A$:GOSUB125:GOSUB250:IFA$="[193]"THENK=NL
  191. 940 NEXTK:GOTO895
  192. 945 C=.:GOSUB840:A1%=C:K=C:GOSUB650:GOSUB10:A$=B$+A$+"":GOSUB125:A$=B$:GOSUB125:GOSUB55
  193. 950 IFA$<>""THENA1%=C:IFA2%>-1THENA$=A$+R$
  194. 955 IFA$<>""THENSYS52430:SYS52420
  195. 960 GOTO895
  196.